package com.gutai.admin.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 
 * 描述：
 * 
 * <pre>
 * HISTORY
 * ****************************************************************************
 *  ID    DATE            PERSON            REASON
 *  1     2018年11月14日         YC           Create
 * ****************************************************************************
 * </pre>
 * 
 * @author YC
 * @version 1.0
 */
@Entity
@Table(name = "nideshop_user")
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    private String username;
    private String password;
    private Short gender;
    private Long birthday;
    private Long registerTime;
    private Long lastLoginTime;
    private String lastLoginIp;
    private Short userLevelId;
    private String nickname;
    private String mobile;
    private String registerIp;
    private String avatar;
    private String weixinOpenid;
    /** 创建时间 */
    @Column(updatable = false, insertable = false)
    private Long createTime;


    public Integer getId() {
        return id;
    }


    public void setId(Integer id) {
        this.id = id;
    }


    public String getUsername() {
        return username;
    }


    public void setUsername(String username) {
        this.username = username;
    }


    public String getPassword() {
        return password;
    }


    public void setPassword(String password) {
        this.password = password;
    }

    public Short getGender() {
        return gender;
    }

    public void setGender(Short gender) {
        this.gender = gender;
    }

    public Long getBirthday() {
        return birthday;
    }

    public void setBirthday(Long birthday) {
        this.birthday = birthday;
    }


    public Long getRegisterTime() {
        return registerTime;
    }


    public void setRegisterTime(Long registerTime) {
        this.registerTime = registerTime;
    }


    public Long getLastLoginTime() {
        return lastLoginTime;
    }


    public void setLastLoginTime(Long lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }


    public String getLastLoginIp() {
        return lastLoginIp;
    }


    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }


    public Short getUserLevelId() {
        return userLevelId;
    }


    public void setUserLevelId(Short userLevelId) {
        this.userLevelId = userLevelId;
    }


    public String getNickname() {
        return nickname;
    }


    public void setNickname(String nickname) {
        this.nickname = nickname;
    }


    public String getMobile() {
        return mobile;
    }


    public void setMobile(String mobile) {
        this.mobile = mobile;
    }


    public String getRegisterIp() {
        return registerIp;
    }


    public void setRegisterIp(String registerIp) {
        this.registerIp = registerIp;
    }


    public String getAvatar() {
        return avatar;
    }


    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }


    public String getWeixinOpenid() {
        return weixinOpenid;
    }


    public void setWeixinOpenid(String weixinOpenid) {
        this.weixinOpenid = weixinOpenid;
    }


    public Long getCreateTime() {
        return createTime;
    }


    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }


    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + ((username == null) ? 0 : username.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        User other = (User) obj;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        if (username == null) {
            if (other.username != null)
                return false;
        } else if (!username.equals(other.username))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "User [id=" + id + ", username=" + username + ", password=" + password + ", gender="
                + gender + ", birthday=" + birthday + ", registerTime=" + registerTime
                + ", lastLoginTime=" + lastLoginTime + ", lastLoginIp=" + lastLoginIp
                + ", userLevalId=" + userLevelId + ", nickName=" + nickname + ", mobile=" + mobile
                + ", registerIp=" + registerIp + ", avatar=" + avatar + ", weixinOpenId="
                + weixinOpenid + "]";
    }

}
